package com.example.shop.fgo.task.download.controller;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class DownloadService extends Service {
    DownloadThread[] mDownloadThreads=new DownloadThread[DownloadThreadCount.MAX_COUNT];

    public DownloadService() {
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        //增强for跑不起来？？
        for (int i = 0; i < mDownloadThreads.length; i++) {
            if (mDownloadThreads[i]==null||!mDownloadThreads[i].isAlive()) {

                mDownloadThreads[i]=new DownloadThread();
                mDownloadThreads[i].start();
            }
        }

        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
